package com.tanhua.app.controller;

import com.tanhua.app.service.SoundService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

import java.io.IOException;

/**
 * @author ：DaLin
 * @date ：2021/1/12 10:20
 */
@RestController
public class SoundController {
    @Autowired
    private SoundService soundService;

    @PostMapping(value = "/peachblossom", name = "发送音频")
    public ResponseEntity saveSound(MultipartFile soundFile) throws IOException {
        return soundService.saveSound(soundFile);
    }

    @GetMapping(value = "/peachblossom", name = "接收语音")
    public ResponseEntity findSound() {
        return soundService.findSound();
    }
}
